var common;
!(function (r) {
  var t = (function () {
    function r() {}
    return (
      (r.transform = function (r, t) {
        if (t && Dictionary[t]) {
          var n = Dictionary[t];
          if (n[r]) return n[r];
        }
        return r;
      }),
      (r.roundHexString = function (t) {
        for (var n, o = r.HEX, e = "", a = 0; a < t; a++)
          (n = Math.round(15 * Math.random())), (e += o.charAt(n));
        return e;
      }),
      (r.roundString = function (r) {
        for (var t, n = "", o = 0; o < r; o++)
          (t = Math.round(62 * Math.random())),
            (n +=
              "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(
                t
              ));
        return n;
      }),
      (r.accessString = function () {
        var t = r.roundString(6);
        console.log(t);
        return (
          t +
          Md5.hashStr(t + r.K)
            .toString()
            .substring(6)
        );
      }),
      (r.getByteLen = function (r) {
        for (var t = 0, n = 0; n < r.length; n++) {
          null != r.charAt(n).match(/[^\x00-\xff]/gi) ? (t += 2) : (t += 1);
        }
        return t;
      }),
      (r.timeString = function (r, t) {
        if ((void 0 === t && (t = !0), r < 0)) return "";
        var n = Math.floor(r / 86400),
          o = Math.floor((r % 86400) / 3600),
          e = Math.floor((r % 3600) / 60),
          a = Math.floor(r % 60),
          u = "",
          i = 0;
        return (
          n > 0 && ((u += n + "天"), i++),
          (o > 0 || i > 0) && ((u += o + "小时"), i++),
          (e > 0 || i > 0) && ((u += e + "分"), i++),
          (a > 0 || i > 0) && t && (u += a + "秒"),
          u
        );
      }),
      (r.setUrlParam = function (r, t, n) {
        return (
          n || (n = Browser.window.location.href),
          n.indexOf("?") > -1 ? (n += "&") : (n += "?"),
          (n = n + r + "=" + t)
        );
      }),
      (r.countDownTriggerEvent = function () {
        var r = Global.startTime,
          t = new Date();
        if (void 0 == r) return !1;
        var n = r.getHours(),
          o = r.getMinutes(),
          e = r.getSeconds();
        o + 5 > 60
          ? (t.setHours(n + 1), t.setMinutes(o + 5 - 60))
          : t.setMinutes(o + 5);
        var a = t.getHours(),
          u = t.getMinutes(),
          i = t.getSeconds();
        console.log(t.getDate());
        return (
          !(
            a * Math.pow(60, 60) +
              60 * u +
              i -
              (n * Math.pow(60, 60) + 60 * o + e) >
            0
          ) && ((Global.isShowMarquee = !0), !0)
        );
      }),
      (r.timeCountDown = function (r) {
        var t = 0,
          n = 0,
          o = 0,
          e = 0;
        (t = Math.floor(r / 86400)),
          (n = Math.floor((r % 86400) / 3600)),
          (o = Math.floor((r % 3600) / 60)),
          (e = Math.floor(r % 60));
        var a = "0秒";
        return (
          t > 0
            ? (a = t + "天" + n + "小时" + o + "分" + e + "秒")
            : n > 0
            ? (a = n + "小时" + o + "分" + e + "秒")
            : o > 0
            ? (a = o + "分" + e + "秒")
            : e > 0 && (a = e + "秒"),
          a
        );
      }),
      (r.restTimeCount = function (r, t) {
        var n = 0,
          o = 0,
          e = 0,
          a = 0;
        (n = Math.floor(r / 86400)),
          (o = Math.floor((r % 86400) / 3600)),
          (e = Math.floor((r % 3600) / 60)),
          (a = Math.floor(r % 60));
        var u = "0秒",
          i = "";
        return (
          (i = "day_hou_min" == t ? "" : a + "秒"),
          n > 0
            ? (u = n + "天" + o + "小时" + e + "分" + i)
            : o > 0
            ? (u = o + "小时" + e + "分" + i)
            : e > 0
            ? (u = e + "分" + i)
            : a > 0 && (u = i),
          u
        );
      }),
      (r.zhuanzhiUtils = function (r, t) {
        var n,
          o,
          e = parseInt(r),
          a = parseInt(t);
        return (
          (n = e > 0 ? e + " 转" : ""), (o = a > 0 ? a + " 级" : ""), n + o
        );
      }),
      (r.dealRole_Type = function (t) {
        return r.transform(t % 10, "roleType");
      }),
      (r.dealCompentResult = function (r, t, n) {
        var o,
          e = r + t + n;
        return (
          r == t && t == n && r == n
            ? (o = "上上签")
            : e <= 13 && e >= 3
            ? (o = e % 2 == 0 ? "少阳" : "少阴")
            : e > 13 && (o = e % 2 == 0 ? "太阳" : "太阴"),
          o
        );
      }),
      (r.dealTransAndLvl = function (r, t) {
        var n = "",
          o = parseInt(r);
        return (
          o < 10
            ? (n = t + "级")
            : o > 10 && o < 99
            ? (n = "1转" + t + "级")
            : o > 100 && o < 999 && (n = "2转" + t + "级"),
          n
        );
      }),
      (r.random = function (r, t) {
        return Math.floor(Math.random() * (t - r)) + r;
      }),
      (r.getNumberFormTextInput = function (r) {
        return parseInt(r.text) > 0 ? parseInt(r.text) : 0;
      }),
      (r.getRewardType = function (r) {
        return 1 == r ? "金" : "银";
      }),
      (r.getUserHeadSkin = function (r, t) {
        parseInt(r) > 10 && (r = (parseInt(r) % 10) + "");
        var n = r + "" + t;
        return (
          "comp/hreoImg/" +
          (Dictionary.wsImgname[n] ? Dictionary.wsImgname[n] : "") +
          ".png"
        );
      }),
      (r.getFuBenDropItem = function (r) {
        var t = "";
        return (
          "1" == r
            ? (t = "银两型")
            : "2" == r
            ? (t = "金砖型")
            : "3" == r
            ? (t = "经验型")
            : "4" == r
            ? (t = "矿石型")
            : "5" == r
            ? (t = "宝石型")
            : "6" == r && (t = "宝物型"),
          t
        );
      }),
      (r.K = "OQVCB0WVHWB2GPS6"),
      (r.HEX = "0123456789abcdef"),
      r
    );
  })();
  r.Utils = t;
})(common || (common = {}));
